package com.mg.admin.service.admin.impl;

import com.mg.admin.bean.admin.RoleVO;
import com.mg.admin.dao.admin.RoleMapper;
import com.mg.admin.service.admin.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("roleServiceImpl")
public class RoleServiceImpl extends BaseService implements RoleService {

    @Autowired
    private RoleMapper roleMapper;


	@Override
	public RoleVO findById(Long id) {
		RoleVO roleVO = roleMapper.findById(id);
		return roleVO;
	}

	@Override
	public List<RoleVO> findAllByOrgId(Long orgId) {
		List<RoleVO> doList = roleMapper.findAllByOrgId(orgId);
		return doList;
	}

	@Override
	public List<RoleVO> findByOrgId(long orgId) {
		List<RoleVO> doList = roleMapper.findByOrgId(orgId);
		return doList;
	}


	@Override
	@Transactional
	public void insertOne(RoleVO roleVO) {
		roleMapper.insertOne(roleVO);
	}

	@Override
	public void updateOne(RoleVO roleVO) {
		roleMapper.updateOne(roleVO);
	}

	@Override
	public void delete(Long id) {
		roleMapper.delete(id);
	}
}